//#**************************************************************
//# filename:             BeamSheardRotvdr_new.h
//#
//# author:               Gruber, Nachbagauer
//#
//# generated:						
//# description:          
//# comments:
//#
//# Copyright (c) 2003-2013 Johannes Gerstmayr, Linz Center of Mechatronics GmbH, Austrian
//# Center of Competence in Mechatronics GmbH, Institute of Technical Mechanics at the 
//# Johannes Kepler Universitaet Linz, Austria. All rights reserved.
//#
//# This file is part of HotInt.
//# HotInt is free software: you can redistribute it and/or modify it under the terms of 
//# the HOTINT license. See folder 'licenses' for more details.
//#
//# bug reports are welcome!!!
//# WWW:		www.hotint.org
//# email:	bug_reports@hotint.org or support@hotint.org
//#***************************************************************************************
 

virtual void GetdRotvdrpos(Matrix& dAvdr, const double r1dy, const double r2dy, const double r3dy,const double r1dz, const double r2dz, const double r3dz, const double v1, const double v2, const double v3)
{
dAvdr(1,1) = -((-(r2dz*r3dy) + r2dy*r3dz)*(2*r2dz*(-(r1dz*r2dy) + r1dy*r2dz) - 2*r3dz*(r1dz*r3dy - r1dy*r3dz))*v1)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5)) - ((r1dz*r3dy - r1dy*r3dz)*(2*r2dz*(-(r1dz*r2dy) + r1dy*r2dz) - 2*r3dz*(r1dz*r3dy - r1dy*r3dz))*v2)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5)) - (r3dz*v2)/Sqrt(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2)) - ((-(r1dz*r2dy) + r1dy*r2dz)*(2*r2dz*(-(r1dz*r2dy) + r1dy*r2dz) - 2*r3dz*(r1dz*r3dy - r1dy*r3dz))*v3)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5)) + (r2dz*v3)/Sqrt(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2));
dAvdr(1,2) = -((-(r2dz*r3dy) + r2dy*r3dz)*(-2*r1dz*(-(r1dz*r2dy) + r1dy*r2dz) + 2*r3dz*(-(r2dz*r3dy) + r2dy*r3dz))*v1)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5)) + (r3dz*v1)/Sqrt(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2)) - ((r1dz*r3dy - r1dy*r3dz)*(-2*r1dz*(-(r1dz*r2dy) + r1dy*r2dz) + 2*r3dz*(-(r2dz*r3dy) + r2dy*r3dz))*v2)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5)) - ((-(r1dz*r2dy) + r1dy*r2dz)*(-2*r1dz*(-(r1dz*r2dy) + r1dy*r2dz) + 2*r3dz*(-(r2dz*r3dy) + r2dy*r3dz))*v3)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5)) - (r1dz*v3)/Sqrt(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2));
dAvdr(1,3) = -((-(r2dz*r3dy) + r2dy*r3dz)*(2*r1dz*(r1dz*r3dy - r1dy*r3dz) - 2*r2dz*(-(r2dz*r3dy) + r2dy*r3dz))*v1)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5)) - (r2dz*v1)/Sqrt(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2)) - ((r1dz*r3dy - r1dy*r3dz)*(2*r1dz*(r1dz*r3dy - r1dy*r3dz) - 2*r2dz*(-(r2dz*r3dy) + r2dy*r3dz))*v2)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5)) + (r1dz*v2)/Sqrt(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2)) - ((-(r1dz*r2dy) + r1dy*r2dz)*(2*r1dz*(r1dz*r3dy - r1dy*r3dz) - 2*r2dz*(-(r2dz*r3dy) + r2dy*r3dz))*v3)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5));
dAvdr(1,4) = -((-(r2dz*r3dy) + r2dy*r3dz)*(-2*r2dy*(-(r1dz*r2dy) + r1dy*r2dz) + 2*r3dy*(r1dz*r3dy - r1dy*r3dz))*v1)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5)) - ((r1dz*r3dy - r1dy*r3dz)*(-2*r2dy*(-(r1dz*r2dy) + r1dy*r2dz) + 2*r3dy*(r1dz*r3dy - r1dy*r3dz))*v2)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5)) + (r3dy*v2)/Sqrt(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2)) - ((-(r1dz*r2dy) + r1dy*r2dz)*(-2*r2dy*(-(r1dz*r2dy) + r1dy*r2dz) + 2*r3dy*(r1dz*r3dy - r1dy*r3dz))*v3)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5)) - (r2dy*v3)/Sqrt(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2));
dAvdr(1,5) = -((-(r2dz*r3dy) + r2dy*r3dz)*(2*r1dy*(-(r1dz*r2dy) + r1dy*r2dz) - 2*r3dy*(-(r2dz*r3dy) + r2dy*r3dz))*v1)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5)) - (r3dy*v1)/Sqrt(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2)) - ((r1dz*r3dy - r1dy*r3dz)*(2*r1dy*(-(r1dz*r2dy) + r1dy*r2dz) - 2*r3dy*(-(r2dz*r3dy) + r2dy*r3dz))*v2)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5)) - ((-(r1dz*r2dy) + r1dy*r2dz)*(2*r1dy*(-(r1dz*r2dy) + r1dy*r2dz) - 2*r3dy*(-(r2dz*r3dy) + r2dy*r3dz))*v3)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5)) + (r1dy*v3)/Sqrt(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2));
dAvdr(1,6) = -((-(r2dz*r3dy) + r2dy*r3dz)*(-2*r1dy*(r1dz*r3dy - r1dy*r3dz) + 2*r2dy*(-(r2dz*r3dy) + r2dy*r3dz))*v1)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5)) + (r2dy*v1)/Sqrt(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2)) - ((r1dz*r3dy - r1dy*r3dz)*(-2*r1dy*(r1dz*r3dy - r1dy*r3dz) + 2*r2dy*(-(r2dz*r3dy) + r2dy*r3dz))*v2)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5)) - (r1dy*v2)/Sqrt(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2)) - ((-(r1dz*r2dy) + r1dy*r2dz)*(-2*r1dy*(r1dz*r3dy - r1dy*r3dz) + 2*r2dy*(-(r2dz*r3dy) + r2dy*r3dz))*v3)/(2.*Power(Power(-(r1dz*r2dy) + r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(-(r2dz*r3dy) + r2dy*r3dz,2),1.5));
dAvdr(2,1) = ((Power(r1dz,2)*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 1.*r2dy*r2dz*r3dy*r3dz + 2*r1dy*r1dz*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz) + Power(r3dy,2)*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2)) + Power(r2dy,2)*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2)) + 3*Power(r1dy,2)*(1.*Power(r2dz,2) + 1.*Power(r3dz,2)))*v1)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((0.5*((r1dy*r1dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r1dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r1dz*r2dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r1dz*r3dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*(Power(r1dy,2)*r1dz*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz) + r1dz*(-0.5*Power(r2dy,3)*r2dz - 0.5*r2dy*r2dz*Power(r3dy,2) - 0.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz) + Power(r1dy,3)*(1.*Power(r2dz,2) + 1.*Power(r3dz,2)) + r1dy*(Power(r1dz,2)*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 1.*r2dy*r2dz*r3dy*r3dz + Power(r3dy,2)*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2)) + Power(r2dy,2)*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2))))*v1)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) - ((-2*r2dz*(r1dz*r2dy - r1dy*r2dz) - 2*r3dz*(r1dz*r3dy - r1dy*r3dz))*(Power(r1dy,2)*r1dz*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz) + r1dz*(-0.5*Power(r2dy,3)*r2dz - 0.5*r2dy*r2dz*Power(r3dy,2) - 0.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz) + Power(r1dy,3)*(1.*Power(r2dz,2) + 1.*Power(r3dz,2)) + r1dy*(Power(r1dz,2)*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 1.*r2dy*r2dz*r3dy*r3dz + Power(r3dy,2)*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2)) + Power(r2dy,2)*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2))))*v1)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - (2*r1dy*(Power(r1dy,2)*r1dz*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz) + r1dz*(-0.5*Power(r2dy,3)*r2dz - 0.5*r2dy*r2dz*Power(r3dy,2) - 0.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz) + Power(r1dy,3)*(1.*Power(r2dz,2) + 1.*Power(r3dz,2)) + r1dy*(Power(r1dz,2)*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 1.*r2dy*r2dz*r3dy*r3dz + Power(r3dy,2)*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2)) + Power(r2dy,2)*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2))))*v1)/(Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2)*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((-0.5*Power(r1dy,3)*r1dz*r2dz + 0.5*r2dy*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(1.*Power(r2dy,3) + 1.*r2dy*Power(r3dy,2)) - 1.5*Power(r2dy,2)*r2dz*r3dy*r3dz - 0.5*r2dz*Power(r3dy,3)*r3dz + 1.*Power(r2dy,3)*Power(r3dz,2) + 0.5*r2dy*Power(r3dy,2)*Power(r3dz,2) + r1dy*r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r2dy + 0.5*r2dy*Power(r2dz,2) - 0.5*r2dz*r3dy*r3dz + 1.*r2dy*Power(r3dz,2)))*(0.5*((r1dy*r1dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r1dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r1dz*r2dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r1dz*r3dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v2)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) + ((-1.5*Power(r1dy,2)*r1dz*r2dz + r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + 2*r1dy*(0.5*Power(r1dz,2)*r2dy + 0.5*r2dy*Power(r2dz,2) - 0.5*r2dz*r3dy*r3dz + 1.*r2dy*Power(r3dz,2)))*v2)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((-2*r2dz*(r1dz*r2dy - r1dy*r2dz) - 2*r3dz*(r1dz*r3dy - r1dy*r3dz))*(-0.5*Power(r1dy,3)*r1dz*r2dz + 0.5*r2dy*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(1.*Power(r2dy,3) + 1.*r2dy*Power(r3dy,2)) - 1.5*Power(r2dy,2)*r2dz*r3dy*r3dz - 0.5*r2dz*Power(r3dy,3)*r3dz + 1.*Power(r2dy,3)*Power(r3dz,2) + 0.5*r2dy*Power(r3dy,2)*Power(r3dz,2) + r1dy*r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r2dy + 0.5*r2dy*Power(r2dz,2) - 0.5*r2dz*r3dy*r3dz + 1.*r2dy*Power(r3dz,2)))*v2)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - (2*r1dy*(-0.5*Power(r1dy,3)*r1dz*r2dz + 0.5*r2dy*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(1.*Power(r2dy,3) + 1.*r2dy*Power(r3dy,2)) - 1.5*Power(r2dy,2)*r2dz*r3dy*r3dz - 0.5*r2dz*Power(r3dy,3)*r3dz + 1.*Power(r2dy,3)*Power(r3dz,2) + 0.5*r2dy*Power(r3dy,2)*Power(r3dz,2) + r1dy*r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r2dy + 0.5*r2dy*Power(r2dz,2) - 0.5*r2dz*r3dy*r3dz + 1.*r2dy*Power(r3dz,2)))*v2)/(Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2)*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((0.5*Power(r2dy,2)*Power(r2dz,2)*r3dy + 1.*Power(r2dz,2)*Power(r3dy,3) + Power(r1dz,2)*(1.*Power(r2dy,2)*r3dy + 1.*Power(r3dy,3)) - 0.5*Power(r1dy,3)*r1dz*r3dz - 0.5*Power(r2dy,3)*r2dz*r3dz - 1.5*r2dy*r2dz*Power(r3dy,2)*r3dz + 0.5*Power(r2dy,2)*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r3dy + 1.*Power(r2dz,2)*r3dy - 0.5*r2dy*r2dz*r3dz + 0.5*r3dy*Power(r3dz,2)))*(0.5*((r1dy*r1dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r1dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r1dz*r2dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r1dz*r3dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v3)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) + ((-1.5*Power(r1dy,2)*r1dz*r3dz + r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + 2*r1dy*(0.5*Power(r1dz,2)*r3dy + 1.*Power(r2dz,2)*r3dy - 0.5*r2dy*r2dz*r3dz + 0.5*r3dy*Power(r3dz,2)))*v3)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((-2*r2dz*(r1dz*r2dy - r1dy*r2dz) - 2*r3dz*(r1dz*r3dy - r1dy*r3dz))*(0.5*Power(r2dy,2)*Power(r2dz,2)*r3dy + 1.*Power(r2dz,2)*Power(r3dy,3) + Power(r1dz,2)*(1.*Power(r2dy,2)*r3dy + 1.*Power(r3dy,3)) - 0.5*Power(r1dy,3)*r1dz*r3dz - 0.5*Power(r2dy,3)*r2dz*r3dz - 1.5*r2dy*r2dz*Power(r3dy,2)*r3dz + 0.5*Power(r2dy,2)*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r3dy + 1.*Power(r2dz,2)*r3dy - 0.5*r2dy*r2dz*r3dz + 0.5*r3dy*Power(r3dz,2)))*v3)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - (2*r1dy*(0.5*Power(r2dy,2)*Power(r2dz,2)*r3dy + 1.*Power(r2dz,2)*Power(r3dy,3) + Power(r1dz,2)*(1.*Power(r2dy,2)*r3dy + 1.*Power(r3dy,3)) - 0.5*Power(r1dy,3)*r1dz*r3dz - 0.5*Power(r2dy,3)*r2dz*r3dz - 1.5*r2dy*r2dz*Power(r3dy,2)*r3dz + 0.5*Power(r2dy,2)*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r3dy + 1.*Power(r2dz,2)*r3dy - 0.5*r2dy*r2dz*r3dz + 0.5*r3dy*Power(r3dz,2)))*v3)/(Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2)*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2)));
dAvdr(2,2) = ((-1.5*Power(r1dy,2)*r1dz*r2dz + r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + r1dy*(1.*Power(r1dz,2)*r2dy - 1.*r2dz*r3dy*r3dz + 2*r2dy*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2))))*v1)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((0.5*((r1dy*r2dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dy*r2dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r2dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dz*r3dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r2dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*(Power(r1dy,2)*r1dz*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz) + r1dz*(-0.5*Power(r2dy,3)*r2dz - 0.5*r2dy*r2dz*Power(r3dy,2) - 0.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz) + Power(r1dy,3)*(1.*Power(r2dz,2) + 1.*Power(r3dz,2)) + r1dy*(Power(r1dz,2)*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 1.*r2dy*r2dz*r3dy*r3dz + Power(r3dy,2)*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2)) + Power(r2dy,2)*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2))))*v1)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) - ((2*r1dz*(r1dz*r2dy - r1dy*r2dz) - 2*r3dz*(r2dz*r3dy - r2dy*r3dz))*(Power(r1dy,2)*r1dz*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz) + r1dz*(-0.5*Power(r2dy,3)*r2dz - 0.5*r2dy*r2dz*Power(r3dy,2) - 0.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz) + Power(r1dy,3)*(1.*Power(r2dz,2) + 1.*Power(r3dz,2)) + r1dy*(Power(r1dz,2)*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 1.*r2dy*r2dz*r3dy*r3dz + Power(r3dy,2)*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2)) + Power(r2dy,2)*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2))))*v1)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - (2*r2dy*(Power(r1dy,2)*r1dz*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz) + r1dz*(-0.5*Power(r2dy,3)*r2dz - 0.5*r2dy*r2dz*Power(r3dy,2) - 0.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz) + Power(r1dy,3)*(1.*Power(r2dz,2) + 1.*Power(r3dz,2)) + r1dy*(Power(r1dz,2)*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 1.*r2dy*r2dz*r3dy*r3dz + Power(r3dy,2)*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2)) + Power(r2dy,2)*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2))))*v1)/(Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2)*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((-0.5*Power(r1dy,3)*r1dz*r2dz + 0.5*r2dy*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(1.*Power(r2dy,3) + 1.*r2dy*Power(r3dy,2)) - 1.5*Power(r2dy,2)*r2dz*r3dy*r3dz - 0.5*r2dz*Power(r3dy,3)*r3dz + 1.*Power(r2dy,3)*Power(r3dz,2) + 0.5*r2dy*Power(r3dy,2)*Power(r3dz,2) + r1dy*r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r2dy + 0.5*r2dy*Power(r2dz,2) - 0.5*r2dz*r3dy*r3dz + 1.*r2dy*Power(r3dz,2)))*(0.5*((r1dy*r2dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dy*r2dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r2dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dz*r3dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r2dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v2)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) + ((0.5*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(3.*Power(r2dy,2) + 1.*Power(r3dy,2)) - 3.*r2dy*r2dz*r3dy*r3dz + 3.*Power(r2dy,2)*Power(r3dz,2) + 0.5*Power(r3dy,2)*Power(r3dz,2) + r1dy*r1dz*(-3.*r2dy*r2dz - 1.*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2) + 0.5*Power(r2dz,2) + 1.*Power(r3dz,2)))*v2)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((2*r1dz*(r1dz*r2dy - r1dy*r2dz) - 2*r3dz*(r2dz*r3dy - r2dy*r3dz))*(-0.5*Power(r1dy,3)*r1dz*r2dz + 0.5*r2dy*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(1.*Power(r2dy,3) + 1.*r2dy*Power(r3dy,2)) - 1.5*Power(r2dy,2)*r2dz*r3dy*r3dz - 0.5*r2dz*Power(r3dy,3)*r3dz + 1.*Power(r2dy,3)*Power(r3dz,2) + 0.5*r2dy*Power(r3dy,2)*Power(r3dz,2) + r1dy*r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r2dy + 0.5*r2dy*Power(r2dz,2) - 0.5*r2dz*r3dy*r3dz + 1.*r2dy*Power(r3dz,2)))*v2)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - (2*r2dy*(-0.5*Power(r1dy,3)*r1dz*r2dz + 0.5*r2dy*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(1.*Power(r2dy,3) + 1.*r2dy*Power(r3dy,2)) - 1.5*Power(r2dy,2)*r2dz*r3dy*r3dz - 0.5*r2dz*Power(r3dy,3)*r3dz + 1.*Power(r2dy,3)*Power(r3dz,2) + 0.5*r2dy*Power(r3dy,2)*Power(r3dz,2) + r1dy*r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r2dy + 0.5*r2dy*Power(r2dz,2) - 0.5*r2dz*r3dy*r3dz + 1.*r2dy*Power(r3dz,2)))*v2)/(Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2)*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((0.5*Power(r2dy,2)*Power(r2dz,2)*r3dy + 1.*Power(r2dz,2)*Power(r3dy,3) + Power(r1dz,2)*(1.*Power(r2dy,2)*r3dy + 1.*Power(r3dy,3)) - 0.5*Power(r1dy,3)*r1dz*r3dz - 0.5*Power(r2dy,3)*r2dz*r3dz - 1.5*r2dy*r2dz*Power(r3dy,2)*r3dz + 0.5*Power(r2dy,2)*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r3dy + 1.*Power(r2dz,2)*r3dy - 0.5*r2dy*r2dz*r3dz + 0.5*r3dy*Power(r3dz,2)))*(0.5*((r1dy*r2dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dy*r2dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r2dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dz*r3dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r2dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v3)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) + ((2.*Power(r1dz,2)*r2dy*r3dy + 1.*r2dy*Power(r2dz,2)*r3dy - 0.5*Power(r1dy,2)*r2dz*r3dz - 1.5*Power(r2dy,2)*r2dz*r3dz - 1.5*r2dz*Power(r3dy,2)*r3dz + 1.*r2dy*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dz*r3dy - 1.*r2dy*r3dz))*v3)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((2*r1dz*(r1dz*r2dy - r1dy*r2dz) - 2*r3dz*(r2dz*r3dy - r2dy*r3dz))*(0.5*Power(r2dy,2)*Power(r2dz,2)*r3dy + 1.*Power(r2dz,2)*Power(r3dy,3) + Power(r1dz,2)*(1.*Power(r2dy,2)*r3dy + 1.*Power(r3dy,3)) - 0.5*Power(r1dy,3)*r1dz*r3dz - 0.5*Power(r2dy,3)*r2dz*r3dz - 1.5*r2dy*r2dz*Power(r3dy,2)*r3dz + 0.5*Power(r2dy,2)*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r3dy + 1.*Power(r2dz,2)*r3dy - 0.5*r2dy*r2dz*r3dz + 0.5*r3dy*Power(r3dz,2)))*v3)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - (2*r2dy*(0.5*Power(r2dy,2)*Power(r2dz,2)*r3dy + 1.*Power(r2dz,2)*Power(r3dy,3) + Power(r1dz,2)*(1.*Power(r2dy,2)*r3dy + 1.*Power(r3dy,3)) - 0.5*Power(r1dy,3)*r1dz*r3dz - 0.5*Power(r2dy,3)*r2dz*r3dz - 1.5*r2dy*r2dz*Power(r3dy,2)*r3dz + 0.5*Power(r2dy,2)*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r3dy + 1.*Power(r2dz,2)*r3dy - 0.5*r2dy*r2dz*r3dz + 0.5*r3dy*Power(r3dz,2)))*v3)/(Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2)*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2)));
dAvdr(2,3) = ((-1.5*Power(r1dy,2)*r1dz*r3dz + r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + r1dy*(1.*Power(r1dz,2)*r3dy - 1.*r2dy*r2dz*r3dz + 2*r3dy*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2))))*v1)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((0.5*((r1dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r2dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r3dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*(Power(r1dy,2)*r1dz*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz) + r1dz*(-0.5*Power(r2dy,3)*r2dz - 0.5*r2dy*r2dz*Power(r3dy,2) - 0.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz) + Power(r1dy,3)*(1.*Power(r2dz,2) + 1.*Power(r3dz,2)) + r1dy*(Power(r1dz,2)*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 1.*r2dy*r2dz*r3dy*r3dz + Power(r3dy,2)*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2)) + Power(r2dy,2)*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2))))*v1)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) - ((2*r1dz*(r1dz*r3dy - r1dy*r3dz) + 2*r2dz*(r2dz*r3dy - r2dy*r3dz))*(Power(r1dy,2)*r1dz*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz) + r1dz*(-0.5*Power(r2dy,3)*r2dz - 0.5*r2dy*r2dz*Power(r3dy,2) - 0.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz) + Power(r1dy,3)*(1.*Power(r2dz,2) + 1.*Power(r3dz,2)) + r1dy*(Power(r1dz,2)*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 1.*r2dy*r2dz*r3dy*r3dz + Power(r3dy,2)*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2)) + Power(r2dy,2)*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2))))*v1)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - (2*r3dy*(Power(r1dy,2)*r1dz*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz) + r1dz*(-0.5*Power(r2dy,3)*r2dz - 0.5*r2dy*r2dz*Power(r3dy,2) - 0.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz) + Power(r1dy,3)*(1.*Power(r2dz,2) + 1.*Power(r3dz,2)) + r1dy*(Power(r1dz,2)*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 1.*r2dy*r2dz*r3dy*r3dz + Power(r3dy,2)*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2)) + Power(r2dy,2)*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2))))*v1)/(Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2)*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((-0.5*Power(r1dy,3)*r1dz*r2dz + 0.5*r2dy*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(1.*Power(r2dy,3) + 1.*r2dy*Power(r3dy,2)) - 1.5*Power(r2dy,2)*r2dz*r3dy*r3dz - 0.5*r2dz*Power(r3dy,3)*r3dz + 1.*Power(r2dy,3)*Power(r3dz,2) + 0.5*r2dy*Power(r3dy,2)*Power(r3dz,2) + r1dy*r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r2dy + 0.5*r2dy*Power(r2dz,2) - 0.5*r2dz*r3dy*r3dz + 1.*r2dy*Power(r3dz,2)))*(0.5*((r1dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r2dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r3dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v2)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) + ((2.*Power(r1dz,2)*r2dy*r3dy + 1.*r2dy*Power(r2dz,2)*r3dy - 0.5*Power(r1dy,2)*r2dz*r3dz - 1.5*Power(r2dy,2)*r2dz*r3dz - 1.5*r2dz*Power(r3dy,2)*r3dz + 1.*r2dy*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dz*r3dy - 1.*r2dy*r3dz))*v2)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((2*r1dz*(r1dz*r3dy - r1dy*r3dz) + 2*r2dz*(r2dz*r3dy - r2dy*r3dz))*(-0.5*Power(r1dy,3)*r1dz*r2dz + 0.5*r2dy*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(1.*Power(r2dy,3) + 1.*r2dy*Power(r3dy,2)) - 1.5*Power(r2dy,2)*r2dz*r3dy*r3dz - 0.5*r2dz*Power(r3dy,3)*r3dz + 1.*Power(r2dy,3)*Power(r3dz,2) + 0.5*r2dy*Power(r3dy,2)*Power(r3dz,2) + r1dy*r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r2dy + 0.5*r2dy*Power(r2dz,2) - 0.5*r2dz*r3dy*r3dz + 1.*r2dy*Power(r3dz,2)))*v2)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - (2*r3dy*(-0.5*Power(r1dy,3)*r1dz*r2dz + 0.5*r2dy*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(1.*Power(r2dy,3) + 1.*r2dy*Power(r3dy,2)) - 1.5*Power(r2dy,2)*r2dz*r3dy*r3dz - 0.5*r2dz*Power(r3dy,3)*r3dz + 1.*Power(r2dy,3)*Power(r3dz,2) + 0.5*r2dy*Power(r3dy,2)*Power(r3dz,2) + r1dy*r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r2dy + 0.5*r2dy*Power(r2dz,2) - 0.5*r2dz*r3dy*r3dz + 1.*r2dy*Power(r3dz,2)))*v2)/(Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2)*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((0.5*Power(r2dy,2)*Power(r2dz,2)*r3dy + 1.*Power(r2dz,2)*Power(r3dy,3) + Power(r1dz,2)*(1.*Power(r2dy,2)*r3dy + 1.*Power(r3dy,3)) - 0.5*Power(r1dy,3)*r1dz*r3dz - 0.5*Power(r2dy,3)*r2dz*r3dz - 1.5*r2dy*r2dz*Power(r3dy,2)*r3dz + 0.5*Power(r2dy,2)*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r3dy + 1.*Power(r2dz,2)*r3dy - 0.5*r2dy*r2dz*r3dz + 0.5*r3dy*Power(r3dz,2)))*(0.5*((r1dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r2dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r3dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v3)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) + ((0.5*Power(r2dy,2)*Power(r2dz,2) + 3.*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(1.*Power(r2dy,2) + 3.*Power(r3dy,2)) - 3.*r2dy*r2dz*r3dy*r3dz + 0.5*Power(r2dy,2)*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dy*r2dz - 3.*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2) + 1.*Power(r2dz,2) + 0.5*Power(r3dz,2)))*v3)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((2*r1dz*(r1dz*r3dy - r1dy*r3dz) + 2*r2dz*(r2dz*r3dy - r2dy*r3dz))*(0.5*Power(r2dy,2)*Power(r2dz,2)*r3dy + 1.*Power(r2dz,2)*Power(r3dy,3) + Power(r1dz,2)*(1.*Power(r2dy,2)*r3dy + 1.*Power(r3dy,3)) - 0.5*Power(r1dy,3)*r1dz*r3dz - 0.5*Power(r2dy,3)*r2dz*r3dz - 1.5*r2dy*r2dz*Power(r3dy,2)*r3dz + 0.5*Power(r2dy,2)*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r3dy + 1.*Power(r2dz,2)*r3dy - 0.5*r2dy*r2dz*r3dz + 0.5*r3dy*Power(r3dz,2)))*v3)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - (2*r3dy*(0.5*Power(r2dy,2)*Power(r2dz,2)*r3dy + 1.*Power(r2dz,2)*Power(r3dy,3) + Power(r1dz,2)*(1.*Power(r2dy,2)*r3dy + 1.*Power(r3dy,3)) - 0.5*Power(r1dy,3)*r1dz*r3dz - 0.5*Power(r2dy,3)*r2dz*r3dz - 1.5*r2dy*r2dz*Power(r3dy,2)*r3dz + 0.5*Power(r2dy,2)*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r3dy + 1.*Power(r2dz,2)*r3dy - 0.5*r2dy*r2dz*r3dz + 0.5*r3dy*Power(r3dz,2)))*v3)/(Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2)*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2)));
dAvdr(2,4) = ((-0.5*Power(r2dy,3)*r2dz - 0.5*r2dy*r2dz*Power(r3dy,2) + 2*r1dy*r1dz*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 0.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz + Power(r1dy,2)*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz))*v1)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((0.5*(-2 + Power(r1dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (0.5*r1dy*r2dy*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + (0.5*r1dy*r3dy*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(Power(r1dy,2)*r1dz*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz) + r1dz*(-0.5*Power(r2dy,3)*r2dz - 0.5*r2dy*r2dz*Power(r3dy,2) - 0.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz) + Power(r1dy,3)*(1.*Power(r2dz,2) + 1.*Power(r3dz,2)) + r1dy*(Power(r1dz,2)*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 1.*r2dy*r2dz*r3dy*r3dz + Power(r3dy,2)*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2)) + Power(r2dy,2)*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2))))*v1)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) - ((2*r2dy*(r1dz*r2dy - r1dy*r2dz) + 2*r3dy*(r1dz*r3dy - r1dy*r3dz))*(Power(r1dy,2)*r1dz*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz) + r1dz*(-0.5*Power(r2dy,3)*r2dz - 0.5*r2dy*r2dz*Power(r3dy,2) - 0.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz) + Power(r1dy,3)*(1.*Power(r2dz,2) + 1.*Power(r3dz,2)) + r1dy*(Power(r1dz,2)*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 1.*r2dy*r2dz*r3dy*r3dz + Power(r3dy,2)*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2)) + Power(r2dy,2)*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2))))*v1)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((-0.5*Power(r1dy,3)*r1dz*r2dz + 0.5*r2dy*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(1.*Power(r2dy,3) + 1.*r2dy*Power(r3dy,2)) - 1.5*Power(r2dy,2)*r2dz*r3dy*r3dz - 0.5*r2dz*Power(r3dy,3)*r3dz + 1.*Power(r2dy,3)*Power(r3dz,2) + 0.5*r2dy*Power(r3dy,2)*Power(r3dz,2) + r1dy*r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r2dy + 0.5*r2dy*Power(r2dz,2) - 0.5*r2dz*r3dy*r3dz + 1.*r2dy*Power(r3dz,2)))*(0.5*(-2 + Power(r1dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (0.5*r1dy*r2dy*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + (0.5*r1dy*r3dy*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*v2)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) + ((1.*Power(r1dy,2)*r1dz*r2dy - 0.5*Power(r1dy,3)*r2dz + 2*r1dz*(1.*Power(r2dy,3) + 1.*r2dy*Power(r3dy,2)) + r1dy*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz))*v2)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((2*r2dy*(r1dz*r2dy - r1dy*r2dz) + 2*r3dy*(r1dz*r3dy - r1dy*r3dz))*(-0.5*Power(r1dy,3)*r1dz*r2dz + 0.5*r2dy*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(1.*Power(r2dy,3) + 1.*r2dy*Power(r3dy,2)) - 1.5*Power(r2dy,2)*r2dz*r3dy*r3dz - 0.5*r2dz*Power(r3dy,3)*r3dz + 1.*Power(r2dy,3)*Power(r3dz,2) + 0.5*r2dy*Power(r3dy,2)*Power(r3dz,2) + r1dy*r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r2dy + 0.5*r2dy*Power(r2dz,2) - 0.5*r2dz*r3dy*r3dz + 1.*r2dy*Power(r3dz,2)))*v2)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((0.5*Power(r2dy,2)*Power(r2dz,2)*r3dy + 1.*Power(r2dz,2)*Power(r3dy,3) + Power(r1dz,2)*(1.*Power(r2dy,2)*r3dy + 1.*Power(r3dy,3)) - 0.5*Power(r1dy,3)*r1dz*r3dz - 0.5*Power(r2dy,3)*r2dz*r3dz - 1.5*r2dy*r2dz*Power(r3dy,2)*r3dz + 0.5*Power(r2dy,2)*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r3dy + 1.*Power(r2dz,2)*r3dy - 0.5*r2dy*r2dz*r3dz + 0.5*r3dy*Power(r3dz,2)))*(0.5*(-2 + Power(r1dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (0.5*r1dy*r2dy*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + (0.5*r1dy*r3dy*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*v3)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) + ((1.*Power(r1dy,2)*r1dz*r3dy + 2*r1dz*(1.*Power(r2dy,2)*r3dy + 1.*Power(r3dy,3)) - 0.5*Power(r1dy,3)*r3dz + r1dy*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz))*v3)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((2*r2dy*(r1dz*r2dy - r1dy*r2dz) + 2*r3dy*(r1dz*r3dy - r1dy*r3dz))*(0.5*Power(r2dy,2)*Power(r2dz,2)*r3dy + 1.*Power(r2dz,2)*Power(r3dy,3) + Power(r1dz,2)*(1.*Power(r2dy,2)*r3dy + 1.*Power(r3dy,3)) - 0.5*Power(r1dy,3)*r1dz*r3dz - 0.5*Power(r2dy,3)*r2dz*r3dz - 1.5*r2dy*r2dz*Power(r3dy,2)*r3dz + 0.5*Power(r2dy,2)*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r3dy + 1.*Power(r2dz,2)*r3dy - 0.5*r2dy*r2dz*r3dz + 0.5*r3dy*Power(r3dz,2)))*v3)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2)));
dAvdr(2,5) = ((-1.5*Power(r1dy,2)*r1dz*r2dy + 2.*Power(r1dy,3)*r2dz + r1dz*(-0.5*Power(r2dy,3) - 0.5*r2dy*Power(r3dy,2)) + r1dy*(1.*Power(r2dy,2)*r2dz + 2.*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz))*v1)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - (((0.5*r1dy*r2dy*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + 0.5*(-2 + Power(r2dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (0.5*r2dy*r3dy*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(Power(r1dy,2)*r1dz*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz) + r1dz*(-0.5*Power(r2dy,3)*r2dz - 0.5*r2dy*r2dz*Power(r3dy,2) - 0.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz) + Power(r1dy,3)*(1.*Power(r2dz,2) + 1.*Power(r3dz,2)) + r1dy*(Power(r1dz,2)*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 1.*r2dy*r2dz*r3dy*r3dz + Power(r3dy,2)*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2)) + Power(r2dy,2)*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2))))*v1)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) - ((-2*r1dy*(r1dz*r2dy - r1dy*r2dz) + 2*r3dy*(r2dz*r3dy - r2dy*r3dz))*(Power(r1dy,2)*r1dz*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz) + r1dz*(-0.5*Power(r2dy,3)*r2dz - 0.5*r2dy*r2dz*Power(r3dy,2) - 0.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz) + Power(r1dy,3)*(1.*Power(r2dz,2) + 1.*Power(r3dz,2)) + r1dy*(Power(r1dz,2)*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 1.*r2dy*r2dz*r3dy*r3dz + Power(r3dy,2)*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2)) + Power(r2dy,2)*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2))))*v1)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((-0.5*Power(r1dy,3)*r1dz*r2dz + 0.5*r2dy*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(1.*Power(r2dy,3) + 1.*r2dy*Power(r3dy,2)) - 1.5*Power(r2dy,2)*r2dz*r3dy*r3dz - 0.5*r2dz*Power(r3dy,3)*r3dz + 1.*Power(r2dy,3)*Power(r3dz,2) + 0.5*r2dy*Power(r3dy,2)*Power(r3dz,2) + r1dy*r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r2dy + 0.5*r2dy*Power(r2dz,2) - 0.5*r2dz*r3dy*r3dz + 1.*r2dy*Power(r3dz,2)))*((0.5*r1dy*r2dy*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + 0.5*(-2 + Power(r2dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (0.5*r2dy*r3dy*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*v2)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) + ((-0.5*Power(r1dy,3)*r1dz + 1.*r2dy*r2dz*Power(r3dy,2) + r1dy*r1dz*(-1.5*Power(r2dy,2) - 0.5*Power(r3dy,2)) - 1.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz + Power(r1dy,2)*(1.*r2dy*r2dz - 0.5*r3dy*r3dz))*v2)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((-2*r1dy*(r1dz*r2dy - r1dy*r2dz) + 2*r3dy*(r2dz*r3dy - r2dy*r3dz))*(-0.5*Power(r1dy,3)*r1dz*r2dz + 0.5*r2dy*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(1.*Power(r2dy,3) + 1.*r2dy*Power(r3dy,2)) - 1.5*Power(r2dy,2)*r2dz*r3dy*r3dz - 0.5*r2dz*Power(r3dy,3)*r3dz + 1.*Power(r2dy,3)*Power(r3dz,2) + 0.5*r2dy*Power(r3dy,2)*Power(r3dz,2) + r1dy*r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r2dy + 0.5*r2dy*Power(r2dz,2) - 0.5*r2dz*r3dy*r3dz + 1.*r2dy*Power(r3dz,2)))*v2)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((0.5*Power(r2dy,2)*Power(r2dz,2)*r3dy + 1.*Power(r2dz,2)*Power(r3dy,3) + Power(r1dz,2)*(1.*Power(r2dy,2)*r3dy + 1.*Power(r3dy,3)) - 0.5*Power(r1dy,3)*r1dz*r3dz - 0.5*Power(r2dy,3)*r2dz*r3dz - 1.5*r2dy*r2dz*Power(r3dy,2)*r3dz + 0.5*Power(r2dy,2)*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r3dy + 1.*Power(r2dz,2)*r3dy - 0.5*r2dy*r2dz*r3dz + 0.5*r3dy*Power(r3dz,2)))*((0.5*r1dy*r2dy*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + 0.5*(-2 + Power(r2dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (0.5*r2dy*r3dy*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*v3)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) + ((-1.*r1dy*r1dz*r2dy*r3dy + 1.*Power(r2dy,2)*r2dz*r3dy + 2.*r2dz*Power(r3dy,3) - 0.5*Power(r2dy,3)*r3dz - 1.5*r2dy*Power(r3dy,2)*r3dz + Power(r1dy,2)*(2.*r2dz*r3dy - 0.5*r2dy*r3dz))*v3)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((-2*r1dy*(r1dz*r2dy - r1dy*r2dz) + 2*r3dy*(r2dz*r3dy - r2dy*r3dz))*(0.5*Power(r2dy,2)*Power(r2dz,2)*r3dy + 1.*Power(r2dz,2)*Power(r3dy,3) + Power(r1dz,2)*(1.*Power(r2dy,2)*r3dy + 1.*Power(r3dy,3)) - 0.5*Power(r1dy,3)*r1dz*r3dz - 0.5*Power(r2dy,3)*r2dz*r3dz - 1.5*r2dy*r2dz*Power(r3dy,2)*r3dz + 0.5*Power(r2dy,2)*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r3dy + 1.*Power(r2dz,2)*r3dy - 0.5*r2dy*r2dz*r3dz + 0.5*r3dy*Power(r3dz,2)))*v3)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2)));
dAvdr(2,6) = ((-1.5*Power(r1dy,2)*r1dz*r3dy + r1dz*(-0.5*Power(r2dy,2)*r3dy - 0.5*Power(r3dy,3)) + 2.*Power(r1dy,3)*r3dz + r1dy*(-1.*r2dy*r2dz*r3dy + 2.*Power(r2dy,2)*r3dz + 1.*Power(r3dy,2)*r3dz))*v1)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - (((0.5*r1dy*r3dy*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + (0.5*r2dy*r3dy*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + 0.5*(-2 + Power(r3dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*(Power(r1dy,2)*r1dz*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz) + r1dz*(-0.5*Power(r2dy,3)*r2dz - 0.5*r2dy*r2dz*Power(r3dy,2) - 0.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz) + Power(r1dy,3)*(1.*Power(r2dz,2) + 1.*Power(r3dz,2)) + r1dy*(Power(r1dz,2)*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 1.*r2dy*r2dz*r3dy*r3dz + Power(r3dy,2)*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2)) + Power(r2dy,2)*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2))))*v1)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) - ((-2*r1dy*(r1dz*r3dy - r1dy*r3dz) - 2*r2dy*(r2dz*r3dy - r2dy*r3dz))*(Power(r1dy,2)*r1dz*(-1.5*r2dy*r2dz - 1.5*r3dy*r3dz) + r1dz*(-0.5*Power(r2dy,3)*r2dz - 0.5*r2dy*r2dz*Power(r3dy,2) - 0.5*Power(r2dy,2)*r3dy*r3dz - 0.5*Power(r3dy,3)*r3dz) + Power(r1dy,3)*(1.*Power(r2dz,2) + 1.*Power(r3dz,2)) + r1dy*(Power(r1dz,2)*(0.5*Power(r2dy,2) + 0.5*Power(r3dy,2)) - 1.*r2dy*r2dz*r3dy*r3dz + Power(r3dy,2)*(1.*Power(r2dz,2) + 0.5*Power(r3dz,2)) + Power(r2dy,2)*(0.5*Power(r2dz,2) + 1.*Power(r3dz,2))))*v1)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((-0.5*Power(r1dy,3)*r1dz*r2dz + 0.5*r2dy*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(1.*Power(r2dy,3) + 1.*r2dy*Power(r3dy,2)) - 1.5*Power(r2dy,2)*r2dz*r3dy*r3dz - 0.5*r2dz*Power(r3dy,3)*r3dz + 1.*Power(r2dy,3)*Power(r3dz,2) + 0.5*r2dy*Power(r3dy,2)*Power(r3dz,2) + r1dy*r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r2dy + 0.5*r2dy*Power(r2dz,2) - 0.5*r2dz*r3dy*r3dz + 1.*r2dy*Power(r3dz,2)))*((0.5*r1dy*r3dy*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + (0.5*r2dy*r3dy*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + 0.5*(-2 + Power(r3dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v2)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) + ((-1.*r1dy*r1dz*r2dy*r3dy - 1.5*Power(r2dy,2)*r2dz*r3dy - 0.5*r2dz*Power(r3dy,3) + 2.*Power(r2dy,3)*r3dz + 1.*r2dy*Power(r3dy,2)*r3dz + Power(r1dy,2)*(-0.5*r2dz*r3dy + 2.*r2dy*r3dz))*v2)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((-2*r1dy*(r1dz*r3dy - r1dy*r3dz) - 2*r2dy*(r2dz*r3dy - r2dy*r3dz))*(-0.5*Power(r1dy,3)*r1dz*r2dz + 0.5*r2dy*Power(r2dz,2)*Power(r3dy,2) + Power(r1dz,2)*(1.*Power(r2dy,3) + 1.*r2dy*Power(r3dy,2)) - 1.5*Power(r2dy,2)*r2dz*r3dy*r3dz - 0.5*r2dz*Power(r3dy,3)*r3dz + 1.*Power(r2dy,3)*Power(r3dz,2) + 0.5*r2dy*Power(r3dy,2)*Power(r3dz,2) + r1dy*r1dz*(-1.5*Power(r2dy,2)*r2dz - 0.5*r2dz*Power(r3dy,2) - 1.*r2dy*r3dy*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r2dy + 0.5*r2dy*Power(r2dz,2) - 0.5*r2dz*r3dy*r3dz + 1.*r2dy*Power(r3dz,2)))*v2)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((0.5*Power(r2dy,2)*Power(r2dz,2)*r3dy + 1.*Power(r2dz,2)*Power(r3dy,3) + Power(r1dz,2)*(1.*Power(r2dy,2)*r3dy + 1.*Power(r3dy,3)) - 0.5*Power(r1dy,3)*r1dz*r3dz - 0.5*Power(r2dy,3)*r2dz*r3dz - 1.5*r2dy*r2dz*Power(r3dy,2)*r3dz + 0.5*Power(r2dy,2)*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r3dy + 1.*Power(r2dz,2)*r3dy - 0.5*r2dy*r2dz*r3dz + 0.5*r3dy*Power(r3dz,2)))*((0.5*r1dy*r3dy*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + (0.5*r2dy*r3dy*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + 0.5*(-2 + Power(r3dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v3)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5)) + ((-0.5*Power(r1dy,3)*r1dz - 0.5*Power(r2dy,3)*r2dz - 1.5*r2dy*r2dz*Power(r3dy,2) + r1dy*r1dz*(-0.5*Power(r2dy,2) - 1.5*Power(r3dy,2)) + 1.*Power(r2dy,2)*r3dy*r3dz + Power(r1dy,2)*(-0.5*r2dy*r2dz + 1.*r3dy*r3dz))*v3)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - ((-2*r1dy*(r1dz*r3dy - r1dy*r3dz) - 2*r2dy*(r2dz*r3dy - r2dy*r3dz))*(0.5*Power(r2dy,2)*Power(r2dz,2)*r3dy + 1.*Power(r2dz,2)*Power(r3dy,3) + Power(r1dz,2)*(1.*Power(r2dy,2)*r3dy + 1.*Power(r3dy,3)) - 0.5*Power(r1dy,3)*r1dz*r3dz - 0.5*Power(r2dy,3)*r2dz*r3dz - 1.5*r2dy*r2dz*Power(r3dy,2)*r3dz + 0.5*Power(r2dy,2)*r3dy*Power(r3dz,2) + r1dy*r1dz*(-1.*r2dy*r2dz*r3dy - 0.5*Power(r2dy,2)*r3dz - 1.5*Power(r3dy,2)*r3dz) + Power(r1dy,2)*(0.5*Power(r1dz,2)*r3dy + 1.*Power(r2dz,2)*r3dy - 0.5*r2dy*r2dz*r3dz + 0.5*r3dy*Power(r3dz,2)))*v3)/(2.*(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Power(Power(r1dz*r2dy - r1dy*r2dz,2) + Power(r1dz*r3dy - r1dy*r3dz,2) + Power(r2dz*r3dy - r2dy*r3dz,2),1.5)*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2)));
dAvdr(3,1) = (-0.25*(2*r1dz - (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(0.5*((r1dy*r1dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r1dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r1dz*r2dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r1dz*r3dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v1)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) + (0.5*(-((r1dy*r1dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (2*Power(r1dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) - (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*v1)/Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2)) - (0.25*(2*r2dz - (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(0.5*((r1dy*r1dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r1dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r1dz*r2dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r1dz*r3dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v2)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) + (0.5*(-((r1dz*r2dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (2*r1dy*r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*v2)/Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2)) - (0.25*(2*r3dz - (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(0.5*((r1dy*r1dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r1dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r1dz*r2dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r1dz*r3dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v3)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) + (0.5*(-((r1dz*r3dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (2*r1dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*v3)/Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2));
dAvdr(3,2) = (-0.25*(2*r1dz - (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(0.5*((r1dy*r2dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dy*r2dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r2dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dz*r3dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r2dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v1)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) + (0.5*(-((r1dy*r2dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (2*r1dy*r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*v1)/Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2)) - (0.25*(2*r2dz - (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(0.5*((r1dy*r2dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dy*r2dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r2dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dz*r3dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r2dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v2)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) + (0.5*(-((r2dy*r2dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (2*Power(r2dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) - (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*v2)/Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2)) - (0.25*(2*r3dz - (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(0.5*((r1dy*r2dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dy*r2dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r2dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dz*r3dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r2dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v3)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) + (0.5*(-((r2dz*r3dy)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (2*r2dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*v3)/Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2));
dAvdr(3,3) = (-0.25*(2*r1dz - (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(0.5*((r1dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r2dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r3dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v1)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) + (0.5*(-((r1dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (2*r1dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*v1)/Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2)) - (0.25*(2*r2dz - (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(0.5*((r1dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r2dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r3dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v2)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) + (0.5*(-((r2dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (2*r2dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*v2)/Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2)) - (0.25*(2*r3dz - (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(0.5*((r1dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r1dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r2dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*r2dy*r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + 0.5*((r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) - (2*Power(r3dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) + (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v3)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) + (0.5*(-((r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (2*Power(r3dy,2)*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/Power(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2),2) - (r1dy*r1dz + r2dy*r2dz + r3dy*r3dz)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*v3)/Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2));
dAvdr(3,4) = (-0.25*(2*r1dz - (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(0.5*(-2 + Power(r1dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (0.5*r1dy*r2dy*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + (0.5*r1dy*r3dy*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*v1)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) + (0.5*(2 - Power(r1dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*v1)/Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2)) - (0.25*(2*r2dz - (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(0.5*(-2 + Power(r1dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (0.5*r1dy*r2dy*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + (0.5*r1dy*r3dy*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*v2)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) - (0.5*r1dy*r2dy*v2)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - (0.25*(2*r3dz - (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(0.5*(-2 + Power(r1dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (0.5*r1dy*r2dy*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + (0.5*r1dy*r3dy*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*v3)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) - (0.5*r1dy*r3dy*v3)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2)));
dAvdr(3,5) = (-0.25*(2*r1dz - (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*((0.5*r1dy*r2dy*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + 0.5*(-2 + Power(r2dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (0.5*r2dy*r3dy*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*v1)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) - (0.5*r1dy*r2dy*v1)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - (0.25*(2*r2dz - (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*((0.5*r1dy*r2dy*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + 0.5*(-2 + Power(r2dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (0.5*r2dy*r3dy*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*v2)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) + (0.5*(2 - Power(r2dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*v2)/Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2)) - (0.25*(2*r3dz - (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*((0.5*r1dy*r2dy*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + 0.5*(-2 + Power(r2dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))) + (0.5*r2dy*r3dy*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*v3)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) - (0.5*r2dy*r3dy*v3)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2)));
dAvdr(3,6) = (-0.25*(2*r1dz - (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*((0.5*r1dy*r3dy*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + (0.5*r2dy*r3dy*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + 0.5*(-2 + Power(r3dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v1)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) - (0.5*r1dy*r3dy*v1)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - (0.25*(2*r2dz - (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*((0.5*r1dy*r3dy*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + (0.5*r2dy*r3dy*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + 0.5*(-2 + Power(r3dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v2)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) - (0.5*r2dy*r3dy*v2)/((Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))*Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2))) - (0.25*(2*r3dz - (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*((0.5*r1dy*r3dy*(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + (0.5*r2dy*r3dy*(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)) + 0.5*(-2 + Power(r3dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2))))*v3)/Power(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2),1.5) + (0.5*(2 - Power(r3dy,2)/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)))*v3)/Sqrt(0.25*Power(-2*r1dz + (r1dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r2dz + (r2dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2) + 0.25*Power(-2*r3dz + (r3dy*(r1dy*r1dz + r2dy*r2dz + r3dy*r3dz))/(Power(r1dy,2) + Power(r2dy,2) + Power(r3dy,2)),2));
}